<!-- MAIN CONTENT -->

<div id="content">
    <div smart-include="app/yksensor/views/sub-header.tpl.html"></div>
    
        <div class="clearfix margin-bottom-10">
                <div class="pull-left margin-left-25">
                    <strong class="font-md">设备编号：</strong>
                    <input type="text" style="vertical-align: middle" id="deviceid_s" ng-model="paginationConf.deviceid">
                </div>
                <div class="pull-left margin-left-25">

                    <strong class="font-md">时间范围：</strong>
                    <label class="input">
                        <input type="text" name="startdate" id="startdate" placeholder="开始日期：" >
                        <i class="icon-append fa fa-calendar"></i>
                    </label>
                    -
                    <label class="input">
                        <input type="text" name="finishdate" id="finishdate" placeholder="结束日期：" >
                        <i class="icon-append fa fa-calendar"></i>
                    </label>
                    <!--<input type="date" style="vertical-align: middle" ng-model="paginationConf.timefrom">
            -
            <input type="date" style="vertical-align: middle" ng-model="paginationConf.timeto">-->
                    <a class="btn btn-primary" href-void="" ng-click="sends()">查询</a>
                   
                </div>
              
                <div class="pull-right">
                    <button class="btn btn-primary glyphicon glyphicon-export" ng-click="exportData()"> 导出</button>
                </div>
</div>
    <div id="exportable" class="table-responsive">
        <table class="table table-bordered table-hover no-margin font-sml table-striped sensor_table">
            <thead>
                <tr>
                    <th class="text-align-center">序号</th>
                    <th class="text-align-center">设备编号</th>
                    <th class="text-align-center">更新时间</th>
                    <th class="text-align-center">数据类型</th>
                    <th class="text-align-center">历史数据</th>
                    <th class="text-align-center">电池电量</th>
                    
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="data in datas">
                    <th class="text-align-center">{{data.order}}</th>
                    <td class="text-align-center">{{data.deviceid}}</td>
                    <td class="text-align-center">{{data.time | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td class="text-align-center">{{data.name == "flow" ? "流量" : (data.name == "pos" ? "液位" : (data.name == "temp" ? "温度" : data.name)) }}</td>
                    <td class="text-align-center">{{data.value}}</td>
                    <td class="text-align-center"><img src="styles/img/ele-H.png"></td>
                </tr>

            </tbody>
        </table>
    </div>
    <!-- end widget content -->
    <div class="dt-toolbar-footer">
        <tm-pagination conf="paginationConf"></tm-pagination>
    </div>

</div>

<script>

    var pagefunction = function() {

		// START AND FINISH DATE
		$('#startdate').datepicker({
		    dateFormat: 'yy-mm-dd',
			prevText : '<i class="fa fa-chevron-left"></i>',
            nextText : '<i class="fa fa-chevron-right"></i>',
            monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],  
            dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],  
            dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],  
            dayNamesMin: ['日','一','二','三','四','五','六'],
			onSelect : function(selectedDate) {
				$('#finishdate').datepicker('option', 'minDate', selectedDate);
			}
		});

		$('#finishdate').datepicker({
			dateFormat : 'yy-mm-dd',
			prevText : '<i class="fa fa-chevron-left"></i>',
            nextText : '<i class="fa fa-chevron-right"></i>',
            monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],  
            dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],  
            dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],  
            dayNamesMin: ['日','一','二','三','四','五','六'],
			onSelect : function(selectedDate) {
				$('#startdate').datepicker('option', 'maxDate', selectedDate);
			}
		});

	};

	// end pagefunction

    pagefunction();


</script>	
<!-- END MAIN CONTENT -->
